package com.nanmeishu.infrastructure.web.entity;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        System.out.println(search("AAAAAAAAAAAAAAAAAAAAA"));

    }

    public static Map<String, Integer> search(String str) {
        if (str.length() < 10) {
            return null;
        }
        HashMap<String,Integer> map=new HashMap<>();

        for (int i = 0; i < str.length()-10; i++) {
            String a="";
            for (int j = i; j < i+10; j++) {
                a+=str.charAt(j);
            }
            Integer count = map.get(a);
            map.put(a,(count == null) ? 1 : count + 1);
        }
        return map;
    }
}
